{extend name="../application/admin/view/layout.html" /}

{block name="head"}

{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form method="post" class="form-horizontal" id="myself">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">我的角色</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="{:session('admin.role')}" disabled="">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">我的登录名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="{:session('admin.login_name')}"
                                       disabled="">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">我的手机</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="{:session('admin.mobile')}" name="mobile">
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-2 control-label">我的头像</label>
                            <div class="col-sm-10 file-area">
                                <div class="file-pretty">
                                    <input type="file" class="form-control" style="display: none;" up-url="{:url('admin/upload')}">
                                    <div class="input-append input-group">
                                            <span class="input-group-btn">
                                                <button class="btn btn-white select" type="button">选择文件</button>
                                            </span>
                                        <input class="input-large form-control" type="text" name="hand_img"  value="{:session('admin.image')}" readonly>
                                        <img class="beforeView" src="" style="display: none;">
                                    </div>
                                </div>
                                <div class="back-change btn btn-primary">查看图片</div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="button" id="sub">保存</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
{/block}

{block name="js"}
<script>
    $(function () {
        // 提交表单
        $('#sub').click(function () {
            http_post(
                "{:url('admin/admin/info')}",
                $('#myself').serialize(),
                function (res) {
                    layer.msg('更新成功',{icon:1},function () {
                        parent.location.reload();
                    })
                }
            )
            return false;
        })
    })
</script>
{/block}